Remove the unneeded setting of the storage file inside the constructor.
authorEmmanuele Bassi <ebassi@cvs.gnome.org>
Tue, 11 Apr 2006 21:04:15 +0000 (21:04 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Tue, 11 Apr 2006 21:04:15 +0000 (21:04 +0000)
2006-04-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>

* gtk/gtkrecentmanager.c (gtk_recent_manager_init)
(gtk_recent_manager_new): Remove the unneeded setting of the
storage file inside the constructor. (Murray Cumming)
(build_recent_items_list): Reset the dirty bit when done rebuilding
the list from the storage file.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkrecentmanager.c

index 8728b139fd70a734f093328053e459c20792c27d..93488b13fff0e190fe720fa2910e9aab6ace5fc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * gtk/gtkrecentmanager.c (gtk_recent_manager_init)
+       (gtk_recent_manager_new): Remove the unneeded setting of the
+       storage file inside the constructor. (Murray Cumming)
+       (build_recent_items_list): Reset the dirty bit when done rebuilding
+       the list from the storage file.
+
 2006-04-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkscale.c (gtk_scale_get_layout_offsets): Silence
index 8728b139fd70a734f093328053e459c20792c27d..93488b13fff0e190fe720fa2910e9aab6ace5fc0 100644 (file)
@@ -1,3 +1,11 @@
+2006-04-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * gtk/gtkrecentmanager.c (gtk_recent_manager_init)
+       (gtk_recent_manager_new): Remove the unneeded setting of the
+       storage file inside the constructor. (Murray Cumming)
+       (build_recent_items_list): Reset the dirty bit when done rebuilding
+       the list from the storage file.
+
 2006-04-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkscale.c (gtk_scale_get_layout_offsets): Silence
index 62b6482513b3a1e2a12b96f01189e69df5410c67..93545da3596f7043c1d67cd1709be431bf25fb7c 100644 (file)
@@ -272,6 +272,8 @@ gtk_recent_manager_init (GtkRecentManager *manager)
   priv->read_in_progress = FALSE;
 
   priv->screen = NULL;
+
+  build_recent_items_list (manager);
 }
 
 static void
@@ -482,14 +484,17 @@ gtk_recent_manager_set_filename (GtkRecentManager *manager,
                                      gtk_recent_manager_poll_timeout,
                                      manager);
 
-  build_recent_items_list (manager);
-  
+  /* mark us clean, so that we can re-read the list
+   * of recently used resources
+   */
   priv->is_dirty = FALSE;
+  build_recent_items_list (manager);
 }
 
 /* reads the recently used resources file and builds the items list.
  * we keep the items list inside the parser object, and build the
  * RecentInfo object only on user's demand to avoid useless replication.
+ * this function resets the dirty bit of the manager.
  */
 static void
 build_recent_items_list (GtkRecentManager *manager)
@@ -564,6 +569,7 @@ build_recent_items_list (GtkRecentManager *manager)
     }
 
   priv->read_in_progress = FALSE;
+  priv->is_dirty = FALSE;
 }
 
 
@@ -591,20 +597,7 @@ build_recent_items_list (GtkRecentManager *manager)
 GtkRecentManager *
 gtk_recent_manager_new (void)
 {
-  GtkRecentManager *retval;
-  gchar *filename;
-
-  filename = g_build_filename (g_get_home_dir (),
-                               GTK_RECENTLY_USED_FILE,
-                              NULL);
-  
-  retval = g_object_new (GTK_TYPE_RECENT_MANAGER,
-                         "filename", filename,
-                        NULL);
-  
-  g_free (filename);
-
-  return retval;
+  return g_object_new (GTK_TYPE_RECENT_MANAGER, NULL);
 }
 
 /**